package cn.itsource.ymcc.domain;

import cn.itsource.ymcc.constants.BaseConstants;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author whale
 * @since 2021-12-02
 */
@TableName("t_kill_activity")
@Data
public class KillActivity extends Model<KillActivity> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String name;

    @TableField("time_str")
    private String timeStr;

    @TableField("begin_time")
    private Long beginTime;

    @TableField("end_time")
    private Long endTime;
    /**
     * 0待发布，1已发布 ，2已取消
     */
    @TableField("publish_status")
    private Integer publishStatus;

    @TableField("publish_time")
    private Date publishTime;

    public String getBeginTimeStr(){
        return BaseConstants.SIMPLE_DATE_FORMAT.format(new Date(getBeginTime()));
    }
    public String getEndTimeStr(){
        return BaseConstants.SIMPLE_DATE_FORMAT.format(new Date(getEndTime()));
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
